<template>
  <div class="container">
    <div class="mask"></div>
    <img :src="preURL" />
    <div class="label">{{ label }}</div>
  </div>
</template>

<script>
export default {
  props: {
    id: { required: true, type: String },
    label: { required: true, type: String },
    preURL: { required: true, type: String },
  },
  methods: {},
};
</script>

<style scoped>
.container {
  cursor: pointer;
  width: 100%;
  height: 100%;
  position: relative;
}
.container:hover {
  color: #00b281;
}
/* 蒙版效果 */
.mask {
  width: 120px;
  height: 160px;
  border-radius: 8px;
  position: absolute;
  z-index: 2000;
}
.mask:hover {
  background-color: rgba(0, 0, 0, 0.085);
}
img {
  width: 120px;
  height: 160px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}
.label {
  height: 40px;
  font-size: 14px;
  /* 固定显示两行 */
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>
